/**
 * @Author: Boring
 * @Description:
 * @File:  service
 * @Date: 2024-03-02 14:50
 */

package service

import (
	"github.com/gin-gonic/gin"
	"oam-manage-backend/controllers/service"
)

func create(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/create", service.Create)
}

func update(serviceGroup *gin.RouterGroup) {
	serviceGroup.PUT("/update", service.Update)
}

func delete(serviceGroup *gin.RouterGroup) {
	serviceGroup.DELETE("/delete", service.Delete)
}

func deleteList(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/deleteList", service.DeleteList)
}

func get(serviceGroup *gin.RouterGroup) {
	serviceGroup.GET("/get", service.Get)
}

func list(serviceGroup *gin.RouterGroup) {
	serviceGroup.GET("/list", service.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	serviceGroup := g.Group("/service")
	create(serviceGroup)
	update(serviceGroup)
	delete(serviceGroup)
	deleteList(serviceGroup)
	get(serviceGroup)
	list(serviceGroup)
}
